<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>监控九分屏</title> 
    <link href="${ctx}/static/ligerui/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="${ctx}/static/ligerui/lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />

    <script src="${ctx}/static/ligerui/lib/jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="${ctx}/static/ligerui/lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script>  
    <link href="${ctx}/static/ligerui/lib/css/common.css" rel="stylesheet" type="text/css" />  
	<link href="${ctx}/static/css/monitor/css/main.css" rel="stylesheet" type="text/css" />

    <script src="${ctx}/static/js/common.js" type="text/javascript"></script>
    <script src="${ctx}/static/ligerui/lib/js/LG.js" type="text/javascript"></script>
    <script type="text/javascript">
    var dialog;
    var items;
	function init() {
		$.ajax({
			type : "POST",
			dataType : "json",
			url : "${ctx}/qso/monitor/monitorVmList",
			data:{winType:"win9"},
			success : function(result) {
				if (typeof (result) == "string") {
					result = eval("(" + result + ")");

				}
				items=result.items;
				var loopTimes=items.length>9?9:items.length; 
				var vm;
				for ( var i = 0; i < loopTimes; i++) {
					vm=items[i];
					var ii=i+1;
					$("#monitorFrame_" + ii).attr("src","${ctx}/qso/monitor/monitorVm/" + vm.vmId);
					$("#userName_"+ii).text(vm.userName);
					
					$("#userName_"+ii).click(function(){
						//绑定各个窗口下超链接的单击事件
						var j=parseInt(this.id.substring(9,10))-1;
						var vmObj=items[j];
						window.parent.addTab(vmObj.vmId,vmObj.userName);
					});
				}
			}
		});
	}
</script>
</head>
<body style="padding:0px; overflow:auto; text-align:center;background:#FFFFFF;"> 
<table class="monitor-window win9" border="1">
	<tr class="screen">
		<td><iframe id="monitorFrame_1" style="width: 100%;height: 100%;"></iframe></td>
		<td><iframe id="monitorFrame_2" style="width: 100%;height: 100%;"></iframe></td>
		<td><iframe id="monitorFrame_3" style="width: 100%;height: 100%;"></iframe></td>
	</tr>
	<tr class="name">
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_1">&nbsp;</a></td>
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_2">&nbsp;</a></td>
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_3">&nbsp;</a></td>
	</tr>
	<tr class="screen">
		<td><iframe id="monitorFrame_4" style="width: 100%;height: 100%;"></iframe></td>
		<td><iframe id="monitorFrame_5" style="width: 100%;height: 100%;"></iframe></td>
		<td><iframe id="monitorFrame_6" style="width: 100%;height: 100%;"></iframe></td>
	</tr>
	<tr class="name">
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_4">&nbsp;</a></td>
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_5">&nbsp;</a></td>
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_6">&nbsp;</a></td>
	</tr>
	<tr class="screen">
		<td><iframe id="monitorFrame_7" style="width: 100%;height: 100%;"></iframe></td>
		<td><iframe id="monitorFrame_8" style="width: 100%;height: 100%;"></iframe></td>
		<td><iframe id="monitorFrame_9" style="width: 100%;height: 100%;"></iframe></td>
	</tr>		
	<tr class="name">
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_7">&nbsp;</a></td>
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_8">&nbsp;</a></td>
		<td><img src="${ctx}/static/css/monitor/img/avatarIcon.png" /><a href="javascript:void(0);" id="userName_9">&nbsp;</a></td>
	</tr>			
</table>
</body>
</html>
